#include <iostream>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

class Solution {
public:
    vector<int> maxInWindows(const vector<int>& num, unsigned int size)
    {
        vector<int> ans;
        if(num.size()<=0||size>num.size()||size==0){
            return ans;
        }
        int sie=num.size();
        for(int i=0;i<sie-size+1;i++){
            int mx=num[i];
            for(int j=i;j<i+size;j++){
                mx=max(mx,num[j]);
            }
            ans.push_back(mx);
        }
        return ans;
    }
};


int main(){
    vector<int> v={2,3,4,2,6,2,5,1};
    Solution s;
    vector<int> a=s.maxInWindows(v,3);
    for(auto x: a){
        cout << x <<" ";
    }cout <<endl;



    return 0;
}